import type {
  BannerItem,
  CategoryItem,
  GoodsInfoPageParams,
  goodsInfo,
  goodsInfoByHot,
  goodsInfoPageByAll,
} from '@/types/home'
import { http } from '@/utils/http'

export const getHomeBanner = () => {
  return http<BannerItem[]>({
    method: 'GET',
    url: 'dictionary/dsLayoutImg/appGetLayoutCarouselList',
    data: {},
  })
}

export const getHomeCatagory = () => {
  return http<CategoryItem[]>({
    method: 'GET',
    url: 'goods/goodsType/appGetGoodsTypeList',
    data: {},
  })
}

export const getGoodsListByHot = () => {
  return http<goodsInfoByHot[]>({
    method: 'GET',
    url: 'goods/goodsInfo/wxGetGoodsListByHot',
    data: {},
  })
}

export const getGoodsListByNew = () => {
  return http<goodsInfoByHot[]>({
    method: 'GET',
    url: 'goods/goodsInfo/appGetGoodsListByNew',
    data: {},
  })
}

export const getGoodsListByRecommend = (data?: GoodsInfoPageParams) => {
  return http<goodsInfoPageByAll<goodsInfo>>({
    method: 'GET',
    url: 'goods/goodsType/WxGetGoodsListByRecommend',
    data,
  })
}
